home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-06-25 | 2.2 KB | 88 lines | [TEXT/CWIE] |
- // ===========================================================================
- // CVBlankBehavior.cp ©1999 Eric Traut
- // ===========================================================================
-
- #include "CVBlankBehavior.h"
- #include "CShadowWindow.h"
-
-
- // ---------------------------------------------------------------------------
- // • CVBlankBehavior
- // ---------------------------------------------------------------------------
-
- CVBlankBehavior::CVBlankBehavior(
- CShadowWindow & inShadowWindow)
- : COffscreenBehavior(inShadowWindow, true, true)
- {
- mLastBlitTicks = ::TickCount();
- mVOffset = 0;
- }
-
-
- // ---------------------------------------------------------------------------
- // • SyncWithShadowWindow
- // ---------------------------------------------------------------------------
-
- Boolean
- CVBlankBehavior::SyncWithShadowWindow(void)
- {
- Boolean didSync;
-
- didSync = COffscreenBehavior::SyncWithShadowWindow();
-
- if (didSync)
- {
- // Recalculate our blur rect
- CWindowRecord * macWindow = mShadowWindow.GetMacWindow();
- mInvertRect = macWindow->port.portRect;
-
- mInvertRect.right -= 15;
- mInvertRect.bottom -= 15;
- mInvertRect.top += 21;
- }
-
- return didSync;
- }
-
-
- // ---------------------------------------------------------------------------
- // • RenderToGWorld
- // ---------------------------------------------------------------------------
-
- Boolean
- CVBlankBehavior::RenderToGWorld(
- StGWorldLocker & inBackingLocker,
- StGWorldLocker & inRenderingLocker)
- {
- // Split the blit into two halves.
-
- Rect destRect;
-
- destRect = mGWorldRect;
- ::OffsetRect(&destRect, 0, mVOffset);
- ::CopyBits( reinterpret_cast<BitMap *>(*inBackingLocker.GetPixMap()),
- reinterpret_cast<BitMap *>(*inRenderingLocker.GetPixMap()),
- &mGWorldRect,
- &destRect,
- srcCopy,
- NULL);
-
- destRect = mGWorldRect;
- ::OffsetRect(&destRect, 0, mVOffset - (mGWorldRect.bottom - mGWorldRect.top));
- ::CopyBits( reinterpret_cast<BitMap *>(*inBackingLocker.GetPixMap()),
- reinterpret_cast<BitMap *>(*inRenderingLocker.GetPixMap()),
- &mGWorldRect,
- &destRect,
- srcCopy,
- NULL);
-
- mVOffset += 2;
-
- if (mVOffset > (mGWorldRect.bottom - mGWorldRect.top))
- mVOffset = 0;
-
- return true;
- }
-
-
-